package com.blue.service;

import org.springframework.stereotype.Service;

@Service
public class UserService {
    public void insertUser() {
        try {
            System.out.println("添加用户中...");
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        if (true && false) {
            throw new RuntimeException("RuntimeException");
        }
    }

    public void deleteUser() {
        try {
            System.out.println("删除用户中...");
            Thread.sleep(500);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    public void modifyUser() {
        try {
            System.out.println("修改用户中...");
            Thread.sleep(300);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    public String selectUserById(Integer id) {
        try {
            System.out.println("查询用户中...");
            Thread.sleep(100);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        return String.valueOf(id);
    }
}
